﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WMSSyncData.Model.WMSModel;
using WMSSyncData.Utils;

namespace WMSSyncData.DAL
{
    public class WMS_T_InventoryDAL : BaseSqlDBDAL<WMS_T_Inventory>
    {
        public int UpdateQty(string storage_SN, string partNumber, decimal qty)
        {
            var sql = string.Format(@"UPDATE  dbo.wms_T_Inventory SET Qty=Qty-{0} WHERE Storage_SN='{1}' AND PartNumber='{2}' AND Qty>={0}", qty, storage_SN, partNumber);
            var result = SqlDBHelper.ExcuteSQL(sql);
            return result;
        }

    }
}
